package com.xebia.lightning.service;

import java.util.List;

import org.springframework.util.CollectionUtils;

import com.xebia.lightning.domain.JobAggregate;

public class JobAggregateServiceImpl implements JobAggregateService {

    public com.xebia.lightning.domain.JobAggregate findJobAggregateForLocation(
            String location) {
        List<JobAggregate> jobAggregates = jobAggregateRepository
                .findAllByLocation(location);
        return CollectionUtils.isEmpty(jobAggregates) ? null : jobAggregates
                .get(0);
    }
}
